﻿using HuaweiCloud.Dotnet.Samples.ESports.Main.Dtos;

namespace HuaweiCloud.Dotnet.Samples.ESports.Main.Manager
{
    public interface IEventsManager
    {
        /// <summary>
        /// 获取当前进行中的活动
        /// </summary>
        /// <param name="token">取消任务的token</param>
        /// <returns></returns>
        Task<List<CommunityEventsDto>?> GetRunningAsync(CancellationToken token = default);
        /// <summary>
        /// 检查当前步数是否满足当任务条件
        /// </summary>
        /// <param name="misson">指定任务</param>
        /// <param name="steps">步数</param>
        /// <returns></returns>
        bool CheckStepEvents(CommunityEventsDto misson, int steps);

        /// <summary>
        /// 检查当前运动记录是否满足当任务条件
        /// </summary>
        /// <param name="misson">指定任务</param>
        /// <param name="type">运动记录类型</param>
        /// <param name="distance">距离</param>
        /// <returns></returns>
        bool CheckSportEvents(CommunityEventsDto misson, string type, int distance);
        /// <summary>
        /// 检查用户是否完成指定活动
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="eventsId">活动Id</param>
        /// <param name="token">取消任务的token</param>
        /// <returns></returns>
        Task<bool> CheckEventsCompletedAsync(Guid userId, Guid eventsId, CancellationToken token = default);
        /// <summary>
        /// 标记用户已完成的活动
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="eventsId">活动Id</param>
        /// <param name="token">取消任务的token</param>
        /// <returns></returns>
        Task CompletedEventsAsync(Guid userId, Guid eventsId, CancellationToken token = default);
    }
}
